package com.originskyseed.platform.cms.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.cms.model.ComplainType;

/**
 * 投诉类型表Mapper类（OSI_COMPLAIN_TYPE）
 *
 * @author WuZhuoXi
 */
public interface ComplainTypeMapper {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(ComplainType record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(ComplainType record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(ComplainType record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(ComplainType record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public ComplainType selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<ComplainType> selectList(ComplainType record) throws Exception;

	/**
	 * 查询最大优先级
	 * 
	 * @return
	 * @throws Exception
	 */
	public Integer selectPrority() throws Exception;

	/**
	 * 更新置顶记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateIsTop(ComplainType record) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<ComplainType> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 根据优先级查询投诉类型
	 * 
	 * @return
	 * @throws Exception
	 */
	public ComplainType selectComplainTypeByPrority(@Param("prority") Integer prority) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public ComplainType selectByPrioritySort(Map<String, Object> params) throws Exception;
}
